package megrez.common.core.bean;

import java.util.HashMap;
import java.util.Map;

import lombok.Data;

/**
 * keycloak事件对象定义
 *  
 * @author Lucky Yang
 * @since 0.0.1
 * @see org.keycloak.events.Event
 */
@Data
public class KeycloakEvent {
    private String id;

    private long time;

    private String type;

    private String realmId;

    private String clientId;

    private String userId;

    private String sessionId;

    private String ipAddress;

    private String error;

    private Map<String, String> details = new HashMap<>();

    public KeycloakEvent addDetail(String key, String value) {
        details.put(key, value);
        return this;
    }
}
